fix: bump fflate and stellar-sdk to resolve OSV HIGH/CRITICAL - #9653
Draft
lokesh-bitgo wants to merge 1 commit into
Draft
fix: bump fflate and stellar-sdk to resolve OSV HIGH/CRITICAL#9653lokesh-bitgo wants to merge 1 commit into
lokesh-bitgo wants to merge 1 commit into
Conversation
Contributor
lokesh-bitgo
force-pushed
the
WCI-1554-vulnerability-fix
branch
from
September 4, 2026 07:56
0aca2d3 to
2a3bc5c
Compare
Contributor
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: WCI-1554
Summary
The
Publish ReleaseGitHub Actions job was failing at the OSV Severity Threshold gate — 3 advisory groups scored at or above the CVSS 7.0 HIGH/CRITICAL cutoff, blocking beta/release publishing.This PR resolves all 3 findings via real dependency upgrades (not exclusions), because in both cases the vulnerable code path is reachable in BitGo's production usage.
What was failing
Root cause analysis
1.
fflate@0.8.2— GHSA-px8p-9vwx-vf98 (CVSS 7.5)unzipSync()enters an infinite loop when parsing a malformed ZIP64 archive (a central directory entry declaringcompressed_size = 0xFFFFFFFFwithout the required ZIP64 extra field). This is a denial-of-service vector — CWE class: uncontrolled resource consumption.jspdf(fflate: "^0.8.1"), which is a dependency ofmodules/key-card(used to generate PDF key cards).jspdf/fflateto compress and generate its own PDF output — it never callsunzipSync()on an externally-supplied archive. The vulnerable code path (decompression of untrusted ZIP data) is not exercised by our usage. This alone would justify anosv-scanner.tomlexclusion (same reasoning class as this repo's existing tar/extraction exclusions), but since a patched version already exists and satisfies jspdf's own version range, we chose to fix it directly instead of adding another exclusion.fflate@0.8.3(published 2026-07-20, patched in the same minor line, no breaking changes).2.
toml@2.3.6— GHSA-82x6-q7mm-w9cf (CVSS 7.5) and GHSA-v5mp-jgw5-2x6j (CVSS 8.2)toml.parse()crashes the Node process withRangeError: Maximum call stack size exceededon a ~5-6 KB deeply nested TOML payload (bare nested arrays or inline tables). No depth guard exists in the parser.toml.parse()can be tricked into writing attacker-controlled keys ontoObject.prototypeby routing a table path through a scalar value into__proto__.__proto__(a duplicate-key guard desync bug in the compiler). This corrupts every object in the process — DoS, logic/auth bypass, and potentially RCE via gadgets, depending on what reads those polluted properties.stellar-sdk@10.4.1(toml: "^2.3.0"), used bymodules/bitgo,modules/sdk-coin-xlm,modules/sdk-coin-algo, andmodules/sdk-coin-hbar.stellar-sdk'sFederation.Server/StellarTomlresolver fetches and parsesstellar.tomlfiles from remote domains during federation/compliance address lookups (xlm.ts→federationLookupByName/federationLookupByAccountId). The domain being queried is derived from the counterparty's Stellar address, i.e. attacker-influenceable input in a real transaction flow. This is a genuinely reachable attack surface in production — unlike this repo's existing tar/minimatch exclusions, which are all dev-tooling-only or usage-mode-mismatched. An exclusion would not be appropriate here.tomlhas no2.3.xpatched release — the fix only exists fromtoml@3.0.0onward.stellar-sdkitself doesn't offer a10.xrelease with a bumpedtoml; the firststellar-sdkversion that depends ontoml@^3.0.0is13.0.0. This forced a major version bump ofstellar-sdk(10.4.1 → 13.3.0), not just a patch.What changed
package.json"fflate": "0.8.3"toresolutionsfflatedependency (viajspdf) to the patched version, same pattern already used in this block forqs,jspdf,**/sha.js, etc.modules/bitgo/package.json"stellar-sdk": "^10.0.1"→"^13.0.0"toml@^3.0.0modules/sdk-coin-xlm/package.json"stellar-sdk": "^10.0.1"→"^13.0.0"modules/sdk-coin-hbar/package.json"stellar-sdk": "^10.0.1"→"^13.0.0"modules/sdk-coin-algo/package.json"stellar-sdk": "^10.0.1"→"^13.0.0"modules/sdk-coin-xlm/src/xlm.tsstellar-sdk@13.xreorganized its exports; without this,sdk-coin-xlmfails to compileyarn.lockfflate@0.8.3,stellar-sdk@13.3.0,toml@3.0.0Breaking-change fix in
xlm.tsstellar-sdk@13.xmoved several exports into namespaces.sdk-coin-xlmwas the only module in the codebase referencing the old paths (confirmed via a repo-wide grep across allstellar-sdkconsumers:bitgo,sdk-coin-algo,sdk-coin-hbar,sdk-coin-xlm,sdk-core):xlm.tsstellar.Serverstellar.Horizon.ServergetMinimumReserve,getBaseTransactionFee)stellar.FederationServerstellar.Federation.ServergetBitGoFederationServerreturn type and constructor call)stellar.FederationServer.Recordstellar.Federation.Api.RecordfederationLookup,federationLookupByName,federationLookupByAccountIdreturn types)These are pure rename/re-export changes on our side — no behavioral logic was touched. Mapping was confirmed directly against
stellar-sdk's shipped.d.tsfiles (lib/index.d.ts,lib/federation/index.d.ts), not guessed.Why not exclude instead of bump
This repo already has a well-established pattern of excluding vulnerabilities in
osv-scanner.tomlwhen the vulnerable code path is provably unreachable (e.g. 19+ existing entries for tar extraction CVEs that don't apply because BitGoJS only usestarfor packing via lerna, never extraction of untrusted archives).That reasoning does not hold for
toml/stellar-sdk: the vulnerable function (toml.parse()) is fed content from a remote server chosen by the counterparty in a federation lookup — a real, reachable, production attack surface. A version bump was the correct fix, not an exclusion.For
fflate, the unreachable-path argument does apply (key-card only compresses, never callsunzipSync()), so an exclusion would have been defensible — but since a drop-in patched version already existed with no breaking changes, fixing it directly was simpler and strictly safer than carrying a permanent exception.Cooldown / supply-chain check
Before adopting these versions, checked publish dates against the general practice of not adopting very-recently-published packages:
fflatetomlstellar-sdkAll three are well clear of any reasonable cooldown window (even a conservative 30-day bar).
Testing performed
yarn buildonsdk-coin-xlm,sdk-coin-algo,sdk-coin-hbar,bitgo— all compile clean withstellar-sdk@13.3.0.yarn unit-teston the 3 directly affected coin modules:sdk-coin-xlm: 108 passing, 0 failingsdk-coin-algo: 231 passing, 0 failingsdk-coin-hbar: 233 passing, 0 failingyarn.lockresolves tofflate@0.8.3,stellar-sdk@13.3.0,toml@3.0.0.stellar-sdkexports.Known caveat
stellar-sdk@13.3.0itself is deprecated in favor of@stellar/stellar-sdk(the package was renamed upstream;stellar-sdk@13.3.0is still real, maintained code, just a deprecated pointer). Migrating to the renamed package is a separate, larger effort and out of scope for this fix — this PR only does the minimum version bump needed to close the CVEs.